package com.moons.uvcdemo.config;

import android.os.Environment;

import java.io.File;

public class DemoConfig {
    //本地数据目录
    public static final String RootPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/ar_face_data/";
    //注册人脸图像路径
    public static final String FacePicPath = RootPath + "ar_face_pic/";
    //数据库路径
    public static final String DatabasePath = RootPath + "ar_face_db/";
    //抓拍路径
    public static final String CapturePath = RootPath + "ar_face_capture/";

    public static final String FeaturesPath = RootPath + "ar_face_feature/";


    public static final String DATABASE_NAME = "userface.db";

    /**
     * 相似度阈值,大于此值，认为是同一个人
     */
    public float feature_threshold = 0.40f;

    private DemoConfig() {
    }

    public static DemoConfig getInstance() {
        return DemoConfigHolder.INSTANCE;
    }

    private static class DemoConfigHolder {
        private static final DemoConfig INSTANCE = new DemoConfig();
    }

    public void updateFolder() {
        File file = new File(DemoConfig.RootPath);
        if (!file.exists()) {
            file.mkdirs();
        }
        File file2 = new File(DemoConfig.FacePicPath);
        if (!file2.exists()) {
            file2.mkdirs();
        }
        File file3 = new File(DemoConfig.DatabasePath);
        if (!file3.exists()) {
            file3.mkdirs();
        }
        File file4 = new File(DemoConfig.CapturePath);
        if (!file4.exists()) {
            file4.mkdirs();
        }
    }
}
